<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>在线文字统计排版工具—陆鹏专用 25.4.18</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: 'Microsoft YaHei', sans-serif;
            background-color: #f0f2f5;
            color: #333;
        }
        .header {
            background-color: #fff;
            border-bottom: 1px solid #e8e8e8;
            padding: 15px 0;
            text-align: center;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }
        .header h1 {
            color: #4285f4;
            font-size: 24px;
            font-weight: normal;
        }
        .container {
            max-width: 900px;
            margin: 20px auto;
            padding: 20px;
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        }
        .editor-container {
            margin-bottom: 20px;
            position: relative;
        }
        .editor {
            width: 100%;
            height: 250px;
            padding: 15px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 16px;
            line-height: 1.6;
            resize: vertical;
            outline: none;
            transition: border-color 0.3s;
        }
        .editor:focus {
            border-color: #4285f4;
        }
        .toolbar {
            display: flex;
            margin-bottom: 10px;
            flex-wrap: wrap;
        }
        .toolbar button {
            margin-right: 5px;
            margin-bottom: 5px;
            padding: 6px 12px;
            background-color: #f5f5f5;
            border: 1px solid #ddd;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
        }
        .toolbar button:hover {
            background-color: #e8e8e8;
        }
        .toolbar button.primary {
            background-color: #4285f4;
            color: white;
            border-color: #4285f4;
        }
        .toolbar button.primary:hover {
            background-color: #3367d6;
        }
        
        /* 查找替换面板样式 */
        .search-replace-panel {
            display: none;
            background-color: #f9f9f9;
            border: 1px solid #ddd;
            border-radius: 4px;
            padding: 15px;
            margin-bottom: 15px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        .search-replace-panel.active {
            display: block;
        }
        .search-replace-row {
            display: flex;
            margin-bottom: 10px;
            align-items: center;
        }
        .search-replace-row:last-child {
            margin-bottom: 0;
        }
        .search-replace-label {
            width: 60px;
            font-size: 14px;
            color: #666;
        }
        .search-replace-input {
            flex: 1;
            padding: 6px 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            margin-right: 10px;
        }
        .search-replace-input:focus {
            border-color: #4285f4;
            outline: none;
        }
        .search-replace-options {
            display: flex;
            margin-top: 10px;
            align-items: center;
        }
        .search-replace-option {
            margin-right: 15px;
            display: flex;
            align-items: center;
            font-size: 13px;
            color: #666;
        }
        .search-replace-option input {
            margin-right: 5px;
        }
        .search-replace-buttons {
            display: flex;
            justify-content: flex-end;
            margin-top: 10px;
        }
        .search-replace-buttons button {
            margin-left: 8px;
        }
        .highlight-match {
            background-color: #ffeb3b;
            border-radius: 2px;
        }

        .stats-container {
            display: flex;
            flex-wrap: wrap;
            margin-top: 20px;
        }
        .stats-section {
            width: 100%;
            margin-bottom: 20px;
        }
        .stats-section h3 {
            font-size: 16px;
            color: #666;
            margin-bottom: 10px;
            padding-bottom: 5px;
            border-bottom: 1px solid #eee;
        }
        .stats-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        .stat-box {
            flex: 1 0 calc(33.333% - 10px);
            min-width: 200px;
            padding: 15px;
            border-radius: 4px;
            background-color: #f9f9f9;
            margin-bottom: 10px;
        }
        .stat-box.highlight {
            background-color: #f0f7ff;
        }
        .stat-box.secondary {
            background-color: #fff0f0;
        }
        .stat-box.tertiary {
            background-color: #f0fff0;
        }
        .stat-box.quaternary {
            background-color: #fff8e1;
        }
        .stat-box.quinary {
            background-color: #e8dfff;
        }
        .stat-title {
            font-size: 14px;
            color: #666;
            margin-bottom: 5px;
        }
        .stat-value {
            font-size: 24px;
            font-weight: bold;
            color: #333;
        }
        /* 为文字数（不含标点符号）添加红色显示 */
        #wordCount {
            color: red;
        }
        .stat-unit {
            font-size: 14px;
            color: #999;
            margin-left: 5px;
        }
        .function-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 20px;
        }
        .function-button {
            flex: 1;
            min-width: 120px;
            padding: 10px;
            text-align: center;
            background-color: #f5f5f5;
            border: 1px solid #ddd;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
        }
        .function-button:hover {
            background-color: #e8e8e8;
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>在线文字统计排版工具—陆鹏专用 25.4.18</h1>
    </div>
    
    <div class="container">
        <div class="editor-container">
            <div class="toolbar">
                <button id="exchangeBtn">文本替换</button>
<button id="readingTimeBtn" class="primary">阅读时长</button>
<button id="copyBtn" class="primary">复制文本</button>
<button id="clearBtn" class="primary">清空文本</button>
            </div>
            
            <!-- 查找替换面板 -->
            <div id="searchReplacePanel" class="search-replace-panel">
                <div class="search-replace-row">
                    <div class="search-replace-label">查找：</div>
                    <input type="text" id="searchInput" class="search-replace-input" placeholder="输入要查找的文本...">
                    <button id="findBtn" class="toolbar-button">查找</button>
                    <button id="findNextBtn" class="toolbar-button">查找下一个</button>
                </div>
                <div class="search-replace-row">
                    <div class="search-replace-label">替换：</div>
                    <input type="text" id="replaceInput" class="search-replace-input" placeholder="输入要替换的文本...">
                    <button id="replaceBtn" class="toolbar-button">替换</button>
                    <button id="replaceAllBtn" class="toolbar-button">全部替换</button>
                </div>
                <div class="search-replace-options">
                    <label class="search-replace-option">
                        <input type="checkbox" id="caseSensitiveOption"> 区分大小写
                    </label>
                    <label class="search-replace-option">
                        <input type="checkbox" id="regexOption"> 使用正则表达式
                    </label>
                </div>
            </div>
            
            <textarea id="editor" class="editor" placeholder="请在此处粘贴或输入文本..."></textarea>
        </div>
        
        <div class="function-buttons">
            <div class="function-button" id="clearFormatBtn">清除格式</div>
            <div class="function-button" id="oneKeyFormatBtn">一键排版</div>
            <div class="function-button" id="clearMarkdownBtn">清除Markdown</div>
        </div>
        
        <div class="stats-container">
            <div class="stats-section">
                <h3>一般统计</h3>
                <div class="stats-grid">
                    <div class="stat-box quinary">
                        <div class="stat-title">预计阅读时长</div>
                        <div class="stat-value" id="readingTime">0</div>
                        <span class="stat-unit">分钟</span>
                    </div>
                    <div class="stat-box secondary">
                        <div class="stat-title">文字数（不含标点符号）</div>
                        <div class="stat-value" id="wordCount">0</div>
                        <span class="stat-unit">个字</span>
                    </div>
                    
                    <div class="stat-box highlight">
                        <div class="stat-title">字符数</div>
                        <div class="stat-value" id="charCount">0</div>
                        <span class="stat-unit">字符</span>
                    </div>
                    
                    <div class="stat-box tertiary">
                        <div class="stat-title">字符数（不含换行）</div>
                        <div class="stat-value" id="charNoLineBreakCount">0</div>
                        <span class="stat-unit">字符</span>
                    </div>
                </div>
            </div>
            
            <div class="stats-section">
                <div class="stats-grid">
                    <div class="stat-box tertiary">
                        <div class="stat-title">字符数（不含空格和换行）</div>
                        <div class="stat-value" id="charNoSpaceLineBreakCount">0</div>
                        <span class="stat-unit">字符</span>
                    </div>
                    
                    <div class="stat-box quaternary">
                        <div class="stat-title">行数</div>
                        <div class="stat-value" id="lineCount">0</div>
                        <span class="stat-unit">行</span>
                    </div>
                    
                    <div class="stat-box quaternary">
                        <div class="stat-title">非空行数</div>
                        <div class="stat-value" id="nonEmptyLineCount">0</div>
                        <span class="stat-unit">行</span>
                    </div>
                </div>
            </div>
            
            <div class="stats-section">
                <div class="stats-grid">
                    <div class="stat-box highlight">
                        <div class="stat-title">字符数 (UTF-8)</div>
                        <div class="stat-value" id="utf8Count">0</div>
                        <span class="stat-unit">字节</span>
                    </div>
                    
                    <div class="stat-box secondary">
                        <div class="stat-title">字符数 (UTF-16)</div>
                        <div class="stat-value" id="utf16Count">0</div>
                        <span class="stat-unit">字节</span>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
    // 新增按钮功能
    document.getElementById('copyBtn').addEventListener('click', function() {
        try {
            navigator.clipboard.writeText(editor.value);
            alert('文本已复制到剪贴板');
        } catch (err) {
            alert('复制失败，请手动选择文本后复制');
        }
    });

    document.getElementById('clearBtn').addEventListener('click', function() {
        editor.value = '';
        countStats();
    });
            const editor = document.getElementById('editor');
            const charCountEl = document.getElementById('charCount');
            const wordCountEl = document.getElementById('wordCount');
            const charNoLineBreakCountEl = document.getElementById('charNoLineBreakCount');
            const charNoSpaceLineBreakCountEl = document.getElementById('charNoSpaceLineBreakCount');
            const lineCountEl = document.getElementById('lineCount');
            const nonEmptyLineCountEl = document.getElementById('nonEmptyLineCount');
            const utf8CountEl = document.getElementById('utf8Count');
            const utf16CountEl = document.getElementById('utf16Count');
            
            // 功能按钮
            const oneKeyFormatBtn = document.getElementById('oneKeyFormatBtn');
            
            // 统计函数
            function countStats() {
                const text = editor.value;
                
                // 字符数
                charCountEl.textContent = text.length;
                
                // 文字数（不含标点符号）
                const wordCount = text.replace(/[\p{P}\p{S}\s]/gu, '').length;
                wordCountEl.textContent = wordCount;
                
                // 字符数（不含换行）
                const charNoLineBreak = text.replace(/\n/g, '').length;
                charNoLineBreakCountEl.textContent = charNoLineBreak;
                
                // 字符数（不含空格和换行）
                const charNoSpaceLineBreak = text.replace(/[\s\n]/g, '').length;
                charNoSpaceLineBreakCountEl.textContent = charNoSpaceLineBreak;
                
                // 行数
                const lines = text.split('\n');
                lineCountEl.textContent = lines.length;
                
                // 非空行数
                const nonEmptyLines = lines.filter(line => line.trim().length > 0).length;
                nonEmptyLineCountEl.textContent = nonEmptyLines;
                
                // UTF-8 字节数
                const utf8Count = new TextEncoder().encode(text).length;
                utf8CountEl.textContent = utf8Count;
                
                // UTF-16 字节数
                const utf16Count = text.length * 2; // 每个字符在UTF-16中占2字节
                utf16CountEl.textContent = utf16Count;
            }
            
            // 初始统计
            countStats();

            // 阅读时长功能
            document.getElementById('readingTimeBtn').addEventListener('click', function() {
                const wordCount = parseInt(wordCountEl.textContent);
                const readingMinutes = Math.ceil(wordCount / 300);
                document.getElementById('readingTime').textContent = readingMinutes;
                this.style.backgroundColor = readingMinutes > 5 ? '#ff9800' : '';
            });
            
            // 监听输入变化
            editor.addEventListener('input', countStats);
            
            // 保存原始文本的变量
            let originalText = '';
            let isFormatted = false;
            let originalTextForClear = '';
            let isCleared = false;
            let originalTextForMarkdown = '';
            let isMarkdownCleared = false;
            
            // 清除Markdown
            const clearMarkdownBtn = document.getElementById('clearMarkdownBtn');
            clearMarkdownBtn.addEventListener('click', function() {
                if (!isMarkdownCleared) {
                    // 保存原始文本
                    originalTextForMarkdown = editor.value;
                    
                    let text = originalTextForMarkdown;
                    
                    // 清除Markdown格式
                    // 1. 清除标题 (# ## ### 等)
                    text = text.replace(/^#{1,6}\s+/gm, '');
                    
                    // 2. 清除加粗和斜体 (** * __ _)
                    text = text.replace(/\*\*(.*?)\*\*/g, '$1'); // 加粗 **text**
                    text = text.replace(/\*(.*?)\*/g, '$1');     // 斜体 *text*
                    text = text.replace(/__(.*?)__/g, '$1');     // 加粗 __text__
                    text = text.replace(/_(.*?)_/g, '$1');       // 斜体 _text_
                    
                    // 3. 清除代码块和行内代码
                    text = text.replace(/```[\s\S]*?```/g, ''); // 代码块 ```code```
                    text = text.replace(/`([^`]+)`/g, '$1');    // 行内代码 `code`
                    
                    // 4. 清除引用
                    text = text.replace(/^>\s+/gm, '');
                    
                    // 5. 清除列表标记
                    text = text.replace(/^[\*\-+]\s+/gm, '');
                    text = text.replace(/^\d+\.\s+/gm, '');
                    
                    // 6. 清除链接和图片
                    text = text.replace(/!\[(.*?)\]\(.*?\)/g, '$1'); // 图片 ![alt](url)
                    text = text.replace(/\[(.*?)\]\(.*?\)/g, '$1');  // 链接 [text](url)
                    
                    // 7. 清除水平线
                    text = text.replace(/^(\s*[\*\-_]){3,}\s*$/gm, '');
                    
                    // 8. 清除表格
                    text = text.replace(/^\|(.*)\|$/gm, '$1');
                    text = text.replace(/^[\s\-|:]+$/gm, '');
                    
                    // 自动排版处理
                    // 1. 删除多余空格
                    text = text.replace(/[ \t]+/g, ' ');
                    
                    // 2. 删除多余换行
                    text = text.replace(/\n{3,}/g, '\n\n');
                    
                    // 3. 段落首行缩进
                    text = text.replace(/^\s*(.+)$/gm, '    $1');
                    
                    // 4. 中英文之间加空格
                    text = text.replace(/([一-龥])([A-Za-z0-9])/g, '$1 $2');
                    text = text.replace(/([A-Za-z0-9])([一-龥])/g, '$1 $2');
                    
                    editor.value = text;
                    clearMarkdownBtn.textContent = '取消清除';
                    clearMarkdownBtn.style.backgroundColor = '#ff9800';
                    isMarkdownCleared = true;
                } else {
                    // 恢复原始文本
                    editor.value = originalTextForMarkdown;
                    clearMarkdownBtn.textContent = '清除Markdown';
                    clearMarkdownBtn.style.backgroundColor = '';
                    isMarkdownCleared = false;
                }
                
                countStats();
            });
            
            // 一键排版
            oneKeyFormatBtn.addEventListener('click', function() {
                if (!isFormatted) {
                    // 保存原始文本
                    originalText = editor.value;
                    
                    let text = originalText;
                    
                    // 1. 删除多余空格
                    text = text.replace(/[ \t]+/g, ' ');
                    
                    // 2. 删除多余换行
                    text = text.replace(/\n{3,}/g, '\n\n');
                    
                    // 3. 段落首行缩进
                    text = text.replace(/^\s*(.+)$/gm, '    $1');
                    
                    // 4. 中英文之间加空格
                    text = text.replace(/([一-龥])([A-Za-z0-9])/g, '$1 $2');
                    text = text.replace(/([A-Za-z0-9])([一-龥])/g, '$1 $2');
                    
                    editor.value = text;
                    oneKeyFormatBtn.textContent = '取消排版';
                    oneKeyFormatBtn.style.backgroundColor = '#ff9800';
                    isFormatted = true;
                } else {
                    // 恢复原始文本
                    editor.value = originalText;
                    oneKeyFormatBtn.textContent = '一键排版';
                    oneKeyFormatBtn.style.backgroundColor = '';
                    isFormatted = false;
                }
                
                countStats();
            });
            
            // 清除格式
            const clearFormatBtn = document.getElementById('clearFormatBtn');
            clearFormatBtn.addEventListener('click', function() {
                if (!isCleared) {
                    // 保存原始文本
                    originalTextForClear = editor.value;
                    
                    let text = originalTextForClear;
                    
                    // 清除格式处理
                    // 1. 删除所有空格
                    text = text.replace(/\s+/g, '');
                    
                    // 2. 保留标点符号（不再删除标点符号）
                    // 原来的代码：text = text.replace(/[\p{P}\p{S}]/gu, '');
                    
                    // 3. 删除所有换行
                    text = text.replace(/\n/g, '');
                    
                    // 4. 在第一自然段前添加两个全角空格作为缩进
                    text = '　　' + text;
                    
                    editor.value = text;
                    clearFormatBtn.textContent = '取消清除';
                    clearFormatBtn.style.backgroundColor = '#ff9800';
                    isCleared = true;
                } else {
                    // 恢复原始文本
                    editor.value = originalTextForClear;
                    clearFormatBtn.textContent = '清除格式';
                    clearFormatBtn.style.backgroundColor = '';
                    isCleared = false;
                }
                
                countStats();
            });
            
            // 查找替换功能
            const exchangeBtn = document.getElementById('exchangeBtn');
            const searchReplacePanel = document.getElementById('searchReplacePanel');
            const searchInput = document.getElementById('searchInput');
            const replaceInput = document.getElementById('replaceInput');
            const findBtn = document.getElementById('findBtn');
            const findNextBtn = document.getElementById('findNextBtn');
            const replaceBtn = document.getElementById('replaceBtn');
            const replaceAllBtn = document.getElementById('replaceAllBtn');
            const caseSensitiveOption = document.getElementById('caseSensitiveOption');
            const regexOption = document.getElementById('regexOption');
            
            // 当前查找位置和匹配项
            let currentMatchIndex = -1;
            let matches = [];
            
            // 切换查找替换面板显示
            exchangeBtn.addEventListener('click', function() {
                searchReplacePanel.classList.toggle('active');
                if (searchReplacePanel.classList.contains('active')) {
                    searchInput.focus();
                    exchangeBtn.classList.add('primary');
                } else {
                    exchangeBtn.classList.remove('primary');
                    // 清除高亮
                    clearHighlights();
                }
            });
            
            // 查找文本
            findBtn.addEventListener('click', function() {
                findText();
            });
            
            // 查找下一个
            findNextBtn.addEventListener('click', function() {
                findNextMatch();
            });
            
            // 替换当前匹配
            replaceBtn.addEventListener('click', function() {
                replaceCurrentMatch();
            });
            
            // 替换所有匹配
            replaceAllBtn.addEventListener('click', function() {
                replaceAllMatches();
            });
            
            // 查找文本函数
            function findText() {
                const text = editor.value;
                const searchText = searchInput.value;
                
                if (!searchText) return;
                
                // 清除之前的高亮
                clearHighlights();
                
                // 重置匹配索引
                currentMatchIndex = -1;
                matches = [];
                
                // 创建正则表达式
                let regex;
                try {
                    if (regexOption.checked) {
                        // 使用用户输入的正则表达式
                        regex = new RegExp(searchText, caseSensitiveOption.checked ? 'g' : 'gi');
                    } else {
                        // 转义正则表达式特殊字符
                        const escapedSearchText = searchText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
                        regex = new RegExp(escapedSearchText, caseSensitiveOption.checked ? 'g' : 'gi');
                    }
                } catch (e) {
                    alert('无效的正则表达式: ' + e.message);
                    return;
                }
                
                // 查找所有匹配
                let match;
                while ((match = regex.exec(text)) !== null) {
                    matches.push({
                        start: match.index,
                        end: match.index + match[0].length,
                        text: match[0]
                    });
                    
                    // 防止无限循环（当匹配空字符串时）
                    if (match.index === regex.lastIndex) regex.lastIndex++;
                }
                
                if (matches.length > 0) {
                    // 高亮第一个匹配
                    findNextMatch();
                } else {
                    alert('未找到匹配项');
                }
            }
            
            // 查找下一个匹配
            function findNextMatch() {
                if (matches.length === 0) {
                    findText();
                    return;
                }
                
                currentMatchIndex = (currentMatchIndex + 1) % matches.length;
                highlightMatch(currentMatchIndex);
            }
            
            // 高亮特定匹配
            function highlightMatch(index) {
                if (index < 0 || index >= matches.length) return;
                
                const match = matches[index];
                
                // 设置选择范围
                editor.focus();
                editor.setSelectionRange(match.start, match.end);
                
                // 确保匹配项在视图中可见
                ensureVisible(match);
            }
            
            // 确保匹配项在视图中可见
            function ensureVisible(match) {
                // 获取文本区域的行高
                const lineHeight = parseInt(window.getComputedStyle(editor).lineHeight);
                
                // 计算匹配项的位置
                const text = editor.value.substring(0, match.start);
                const lines = text.split('\n').length - 1;
                
                // 滚动到匹配项位置
                editor.scrollTop = lines * lineHeight;
            }
            
            // 替换当前匹配
            function replaceCurrentMatch() {
                if (currentMatchIndex < 0 || matches.length === 0) {
                    alert('请先查找要替换的文本');
                    return;
                }
                
                const match = matches[currentMatchIndex];
                const replaceText = replaceInput.value;
                
                // 替换文本
                const text = editor.value;
                editor.value = text.substring(0, match.start) + replaceText + text.substring(match.end);
                
                // 更新统计
                countStats();
                
                // 更新匹配项位置
                const lengthDiff = replaceText.length - match.text.length;
                for (let i = currentMatchIndex + 1; i < matches.length; i++) {
                    matches[i].start += lengthDiff;
                    matches[i].end += lengthDiff;
                }
                
                // 移除当前匹配
                matches.splice(currentMatchIndex, 1);
                
                // 如果还有匹配项，高亮下一个
                if (matches.length > 0) {
                    // 调整当前索引
                    if (currentMatchIndex >= matches.length) {
                        currentMatchIndex = 0;
                    }
                    highlightMatch(currentMatchIndex);
                } else {
                    currentMatchIndex = -1;
                }
            }
            
            // 替换所有匹配
            function replaceAllMatches() {
                if (matches.length === 0) {
                    findText();
                    if (matches.length === 0) return;
                }
                
                const searchText = searchInput.value;
                const replaceText = replaceInput.value;
                
                // 创建正则表达式
                let regex;
                try {
                    if (regexOption.checked) {
                        regex = new RegExp(searchText, caseSensitiveOption.checked ? 'g' : 'gi');
                    } else {
                        const escapedSearchText = searchText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
                        regex = new RegExp(escapedSearchText, caseSensitiveOption.checked ? 'g' : 'gi');
                    }
                } catch (e) {
                    alert('无效的正则表达式: ' + e.message);
                    return;
                }
                
                // 替换所有匹配
                const text = editor.value;
                const newText = text.replace(regex, replaceText);
                editor.value = newText;
                
                // 更新统计
                countStats();
                
                // 重置匹配
                matches = [];
                currentMatchIndex = -1;
                
                // 显示替换结果
                const count = (text.match(regex) || []).length;
                alert(`已替换 ${count} 处匹配项`);
            }
            
            // 清除高亮
            function clearHighlights() {
                // 在文本区域中，我们通过取消选择来清除高亮
                editor.selectionStart = editor.selectionEnd;
            }
            
            // 监听搜索输入框的回车键
            searchInput.addEventListener('keydown', function(e) {
                if (e.key === 'Enter') {
                    e.preventDefault();
                    if (e.shiftKey) {
                        findNextMatch();
                    } else {
                        findText();
                    }
                }
            });
            
            // 监听替换输入框的回车键
            replaceInput.addEventListener('keydown', function(e) {
                if (e.key === 'Enter') {
                    e.preventDefault();
                    if (e.ctrlKey) {
                        replaceAllMatches();
                    } else {
                        replaceCurrentMatch();
                    }
                }
            });
        });
    </script>
</body>
</html>